package com.tianji.learning.service;

import com.tianji.common.domain.dto.PageDTO;
import com.tianji.common.domain.query.PageQuery;
import com.tianji.learning.model.po.LearningLesson;
import com.baomidou.mybatisplus.extension.service.IService;
import com.tianji.learning.model.vo.LearningLessonVO;
import com.tianji.learning.model.vo.LearningPlanPageVO;
import com.tianji.learning.model.vo.LessonStatusVO;

import java.util.List;

/**
 * <p>
 * 学生课表 服务类
 * </p>
 *
 * @author AvA
 * @since 2024-12-06
 */
public interface ILearningLessonService extends IService<LearningLesson> {

    /**
     * 添加课程信息到用户课程表
     *
     * @param userId
     * @param courseIds
     */
    void addUserLessons(Long userId, List<Long> courseIds);

    /**
     * 查询我的课表
     *
     * @param query
     * @return
     */
    PageDTO<LearningLessonVO> queryMyLessons(PageQuery query);

    /**
     * 查询当前用户正在学习的课程
     *
     * @return
     */
    LearningLessonVO queryMyCurrentLesson();

    /**
     * 删除课表中课程
     *
     * @param userId
     * @param courseIds
     */
    void removeUserLessons(Long userId, List<Long> courseIds);

    /**
     * 检查课程是否有效
     *
     * @param courseId
     * @return
     */
    Long isLessonValid(Long courseId);

    /**
     * 查询用户课表中指定课程状态
     *
     * @param courseId
     * @return
     */
    LessonStatusVO getLessonStatusByCourseId(Long courseId);

    /**
     * 统计课程的学习人数
     *
     * @param courseId
     * @return
     */
    Integer countLearningLessonByCourse(Long courseId);

    /**
     * 查询课表
     *
     * @param userId
     * @param courseId
     * @return
     */
    LearningLesson queryByUserAndCourseId(Long userId, Long courseId);

    /**
     * 创建学习计划
     *
     * @param courseId
     * @param freq
     */
    void createLearningPlans(Long courseId, Integer freq);

    /**
     * 查询我的学习计划
     *
     * @param query
     * @return
     */
    LearningPlanPageVO queryMyPlans(PageQuery query);
}
